﻿<%@ Page Title="Làm bài thi" Language="C#" MasterPageFile="~/HocVien/HocVien.master" AutoEventWireup="true" CodeFile="frmBaiThi.aspx.cs" Inherits="HocVien_frmBaiThi" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%">
        <tr>
            <td>
                &nbsp;Mã Đề Thi:
                <asp:Label ID="lblMaDT" runat="server" Text="lblmadt" ForeColor="#999966"></asp:Label>
                <br />
                &nbsp;Mã Bài Thi:
                <asp:Label runat="server" Text="mabaithi" ID="lblmabt" ForeColor="#999966"></asp:Label>
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ngày 
                tháng:&nbsp;
                <asp:Label ID="lblNgayGio" runat="server" Text="lblShortDatetime"></asp:Label>
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="lblTenBaiThi" runat="server" BorderStyle="None" 
                    ForeColor="#003300" Text="Bai Kiem Tra  Cuoi Ky" Font-Bold=True 
                    Height="17px"></asp:Label> 
                    <div align=center style="color:Red" id="lblFlowTime">Thời gian còn lại: <h1 id="lblTime" ></h1></div>
                <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                
                <br />
                <asp:Panel ID="Panel2" runat="server" BackColor="#FFFFCC" BorderStyle="Groove" 
                    Width="186px">
                    <asp:Label ID="lbltenma" runat="server" Text="Mã Thí Sinh: "></asp:Label>
                    <asp:Label ID="lblMathisinh" runat="server" Font-Bold="true" Font-Italic="true" 
                        ForeColor="Gray"></asp:Label>
                </asp:Panel>
                <br />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto">
                    <asp:DataList ID="DataList1" runat="server" GridLines="Vertical" 
                        RepeatLayout="Flow">
                        <ItemTemplate>
                            <asp:Label ID="lblMaCH" runat="server" Text='<%# Eval("MaCH1") %>' 
                            Visible="False"></asp:Label>
                            <asp:Label ID="Label3" runat="server" Text="Câu "></asp:Label>
                            <asp:Label ID="lblstt" runat="server" Text='<%# Eval("STT1") %>'></asp:Label>
                            <asp:Label ID="Label4" runat="server" Text=":"></asp:Label>
                            &nbsp;<asp:Label ID="lblND" runat="server" Text='<%# Eval("Noidung1") %>'></asp:Label>
                            <br />
                            <br />
                            <asp:RadioButton ID="RadioButton5" runat="server" GroupName="b" 
                            Text='<%# Eval("Pa11") %>' />
                            <br />
                            <br />
                            <asp:RadioButton ID="RadioButton6" runat="server" GroupName="b" 
                            Text='<%# Eval("Pa21") %>' />
                            <br />
                            <br />
                            <asp:RadioButton ID="RadioButton7" runat="server" GroupName="b" 
                            Text='<%# Eval("Pa31") %>' />
                            <br />
                            <br />
                            <asp:RadioButton ID="RadioButton8" runat="server" GroupName="b" 
                            Text='<%# Eval("Pa41") %>' />
                            <br />
                            _____________________________________________________<br />
                        </ItemTemplate>
                    </asp:DataList>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" 
                    Text="Submit" />
            </td>
        </tr>
    </table>
   
    <script type="text/javascript">
   
var leave = <%=seconds%>
CounterTimer();
var interv=setInterval(CounterTimer,1000);
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=450,height=250,scrollbars=no,resizable=0');
return false;
}

function CounterTimer()
{
var hour = Math.floor(leave / 3600)
var minute = Math.floor(leave / 60) - (hour * 60)
var second = Math.floor(leave) - (hour * 60 * 60) - (minute*60)
hour=hour<10 ? "0" + hour : hour;
minute=minute<10 ? "0" + minute : minute;
second=second<10 ? "0" + second : second;
var remain=hour + ":"+minute+":"+second;
leave=leave-1;
document.getElementById("lblTime").innerHTML=remain;
if(leave==180)
{
    return popup("popupnew.htm",'Notes');
    
}
if(leave==-1)
{
    alert("THÔNG BÁO! Đã hết giờ làm bài, những câu bạn không trả lời sẽ mặc định là null. Cám ơn và hẹn gặp lại. Nhấn OK để chuyển sang trang xem kết quả");
    interv=window.clearInterval(interv);
    document.getElementById('<%=btnSubmit.ClientID%>').click();
    //window.location="frmKetQuaThi.aspx";
}
}
</script>
</asp:Content>

